<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>调拨单</title>
    <link rel="stylesheet" href="../commonCss/reset.css" />
    <link rel="stylesheet" href="../commonCss/vant.css" />
    <link rel="stylesheet" href="../css/dbd.css">
</head>

<body>
    <div id="dbd" v-cloak>
        <!-- <van-sticky>
            <van-nav-bar style="background-color: #e1e1e1e1;">
                <template #title>
                    <span style="font-size: 16px;font-weight: bold;">调拨单</span>
                </template>
            </van-nav-bar>
        </van-sticky>

        <van-list class="oneList-style" v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
            <van-cell v-for="item in list" :key="item" :title="item.ROWID" @click="msgPopoverBtn(item.id)">
                <template #title>
                    <p class="isflexBet">
                        <span>单号：{{item.aaa}}</span>
                        <span>{{item.bbb}}</span>
                    </p>
                </template>
                <template #label>
                    <div>
                        <van-row type="flex" justify="space-between">
                            <van-col>原部门：{{item.aaa}}</van-col>
                            <van-col>目标部门：{{item.aaa}}</van-col>
                        </van-row>
                        <van-row type="flex" justify="space-between">
                            <van-col>创建人：{{item.aaa}}</van-col>
                            <van-col>创建时间：{{item.aaa}}</van-col>
                        </van-row>
                        <van-row type="flex" justify="space-between">
                            <van-col>审核人：{{item.aaa}}</van-col>
                            <van-col>审核时间：{{item.aaa}}</van-col>
                        </van-row>
                    </div>
                </template>
            </van-cell>

        </van-list> -->

        <!-- 弹出层 -->
        <van-popup v-model="msgPopover" position="right" style="width: 100%;height: 100%;">
            <div class="bar">
                <van-sticky>
                    <van-nav-bar title="调拨单">
                        <!-- <template #left>
                            <div class="backStyle" @click="msgClose()">
                                <van-icon name="arrow-left"></van-icon>
                                <span>返回</span>
                            </div>
                        </template> -->
                    </van-nav-bar>
                </van-sticky>
                <!-- <div class="handeline-style">
                    <div class="isFlexBet">
                        <p>单号：{{dataObj.a}}</p>
                        <p>类型：{{dataObj.a}}</p>
                    </div>
                    <div class="isFlexBet">
                        <p>目标部门：{{dataObj.a}}</p>                        
                        <p>目标仓库：{{dataObj.a}}</p>
                    </div>                        
                    <p>新品名：{{dataObj.a}}</p>                        
                    <p>备注：{{dataObj.a}}</p>                        
                </div> -->

                <div class="twoList-style">
                    <!-- <h4>物料信息: </h4> -->
                    <div class="card">
                        <div class="isflexBet pSty">
                            <p>单号:</p>
                            <p class="textColor">{{list.dh}}</p>
                        </div>
                        <div class="isflexBet pSty">
                            <p>原部门:</p>
                            <p class="textColor">{{list.ybm}}</p>
                        </div>
                        <div class="isflexBet pSty">
                            <p> 目标部门:</p>
                            <p class="textColor">{{list.xbm}}</p>
                        </div>
                        <div class="isflexBet pSty">
                            <p>创建人：</p>
                            <p class="textColor">{{list.Name}}</p>
                        </div>
                        <div class="isflexBet pSty">
                            <p>创建时间:</p>
                            <p class="textColor">{{list.createtime}}</p>
                        </div>
                        <!-- <div class="isflexBet pSty">
                            <p>审核人:</p>
                            <p class="textColor">{{dataObj.a}}</p>
                        </div> -->
                        <div class="isflexBet pSty">
                            <p>审核时间:</p>
                            <p class="textColor">{{list.time}}</p>
                        </div>
                        <div class="isflexBet pSty">
                            <p>是否接收:</p>
                            <p class="textColor">{{list.receivetx}}</p>
                        </div>
                        <!-- <div class="isflexBet pSty">
                            <p>件数:</p>
                            <p class="textColor">{{dataObj.a}}</p>
                        </div>
                        <div class="isflexBet pSty">
                            <p>单价:</p>
                            <p class="textColor">{{dataObj.a}}</p>
                        </div>
                        <div class="isflexBet pSty">
                            <p>调拨单价:</p>
                            <p class="textColor">{{dataObj.a}}</p>
                        </div>
                        <div class="isflexBet pSty">
                            <p>金额:</p>
                            <p class="textColor">{{dataObj.a}}</p>
                        </div> -->
                    </div>

                    <van-cell v-for="item in tableListOne" :key="item">
                        <template #title>
                            <p>原仓库：{{item.targetcktx}}</p>
                            <p>目标仓库：{{item.cktx}}</p>
                        </template>
                        <template #label>
                            <div>
                                <van-row type="flex" justify="space-between">
                                    <van-col>品种：{{item.newmc}}</van-col>
                                    <van-col>卷号：{{item.juanhao}}</van-col>
                                </van-row>
                                <van-row type="flex" justify="space-between">
                                    <van-col>浆纱缸号：{{item.pg}}</van-col>
                                    <van-col>调拨单价：{{item.cost}}</van-col>
                                </van-row>
                                <van-row type="flex" justify="space-between">
                                    <van-col style="color:black">总匹数：<span>{{item.totalPishu}}</span></van-col>
                                    <van-col>单位：{{item.unit}}</van-col>
                                </van-row>                                
                                <van-row type="flex" justify="space-between">
                                    <van-col style="color:black">总数量：<span>{{item.totalNum}}</span></van-col>
                                    <van-col style="color:black">总金额：<span>{{item.totalPrice}}</span></van-col>
                                </van-row>
                                
                            </div>
                        </template>
                    </van-cell>
                              

                </div>

                <div class="btn-style">
                    <van-button type="default" size="large" @click="clickListPopover">查看</van-button>
                </div>
                <div v-if="list.auditstatus>=2"></div>
                <div class="btn-style" v-else>
                    <van-button type="info" size="large" @click="clickMsgBtn">审核</van-button>
                </div>
            </div>
        </van-popup>

        <!-- 审核 -->
        <van-popup v-model="showMsg" position="bottom" :style="{ height: '32%' }">
            <div style="width:100%;position:absolute; bottom:0">
                <van-form @submit="onSubmit">
                    <van-field name="radio" label="审核状态">
                        <template #input>
                            <van-radio-group v-model="radio" direction="horizontal">
                                <van-radio name="1" style="padding: 5px;">通过</van-radio>
                                <van-radio name="0" style="padding: 5px;">不通过</van-radio>
                            </van-radio-group>
                        </template>
                    </van-field>
                    <van-field v-model="message" label="审核意见:" placeholder="可填写" rows="2" type="textarea"
                        show-word-limit>
                    </van-field>
                    <div style="margin: 16px;">
                        <van-button round block type="info" native-type="submit">
                            保存
                        </van-button>
                    </div>
                </van-form>
            </div>
        </van-popup>


        <!-- 列表 -->
        <van-popup v-model="listPopover" position="bottom" style="width: 100%;height: 100%;">
            <div>
                <van-sticky>
                    <!-- 查看详情 -->
                    <van-nav-bar title="查看详情">
                        <template #left>
                            <div class="backStyle" @click="listPopover = false">
                                <van-icon name="arrow-left"></van-icon>
                                <span>返回</span>
                            </div>
                        </template>
                    </van-nav-bar>
                </van-sticky>

                <div v-if="!tableList.length" style="height:85vh;line-height:85vh;text-align: center;">
                    <van-loading>
                        加载中...
                    </van-loading>
                </div>
                <div class="look" v-else>
                    <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad"
                        :immediate-check="false">

                        <van-cell v-for="item in tableList" :key="item">
                            <template #title>
                                <p>原仓库：{{item.targetcktx}}</p>
                                <p>目标仓库：{{item.cktx}}</p>
                            </template>
                            <template #label>
                                <div>
                                    <van-row type="flex" justify="space-between">
                                        <van-col>品种：{{item.newmc}}</van-col>
                                        <van-col>卷号：{{item.juanhao}}</van-col>
                                    </van-row>
                                    <van-row type="flex" justify="space-between">
                                        <van-col>数量：{{item.num}}</van-col>
                                        <van-col>单位：{{item.unit}}</van-col>
                                    </van-row>
                                    <van-row type="flex" justify="space-between">
                                        <van-col>浆纱缸号：{{item.pg}}</van-col>
                                        <van-col>调拨单价：{{item.cost}}</van-col>
                                    </van-row>
                                    <van-row type="flex" justify="flex-start">
                                        <van-col>金额：{{item.sum}}</van-col>
                                    </van-row>
                                    <van-row type="flex" justify="flex-start">
                                        <van-col>备注：{{item.remarks}}</van-col>
                                    </van-row>
                                </div>
                            </template>
                        </van-cell>

                    </van-list>

                </div>
            </div>
        </van-popup>

    </div>
</body>
<script src="../commonJs/vue.min.js"></script>
<script src='http://dongtai.fsslpc.com/w/web/common/jquery.js'></script>
<script src="../commonJs/vant.min.js"></script>
<script src="../commonJs/common.js"></script>
<script src="../js/dbd.js"></script>

</html>